import { createApp } from 'vue'
import ElementPlus from 'element-plus'
import App from './App.vue'
import router from './router/index';
import 'element-plus/dist/index.css'
import './index.css'
import "./style/elreset.less";
import "./style/cssreset.css";
import "./style/public.less";
// 字体图标库
import "./iconfont/iconfont.css";
import "./iconfont/font/iconfont.css";
import  piniaPluginPersistedstate from 'pinia-plugin-persistedstate'

import { createPinia } from 'pinia';
//饿了么国际化
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
import guard from "@/router/guard"

// 创建pinia实例
const pinia = createPinia()
//使用持久化
pinia.use(piniaPluginPersistedstate)
const app = createApp(App)

app.use(pinia);
// 等pinia挂载之后执行, 并且在挂载前先添加路由表
// debugger
guard();
app.use(router);
app.use(ElementPlus,{
    locale: zhCn,
})
app.mount('#app')
